#define _CRT_SECURE_NO_WARNINGS 1
#include"Head.h"
class Solution {
public:
    string reverseStr(string s, int k) {
        for (int i = 0; i < s.size(); i += 2 * k)
        {
            int minLen = min(k, s.size() - 1 - i);
            reverse(s.begin(), s.begin() + minLen);
        }
        return s;
    }
};
int main()
{
    Solution s;
    cout << s.reverseStr("abcdefg", 2) << endl;
    cout << s.reverseStr("abcd", 2) << endl;
    cout << min(1, 2) << endl;
}